package CAD.shujuku;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class JdbcMysqlTest {
    private static Connection conn;
    public static Connection jdbc() throws ClassNotFoundException, SQLException {
            Connection conn = null;
            Class.forName("com.mysql.cj.jdbc.Driver");
//2.定义连接url
            String url = "jdbc:mysql://127.0.0.1:3306/db1?serverTimezone=UTC";
//3.获取数据库连接对象
            conn = DriverManager.getConnection(url, "root", "265411");
        return conn;
    }
}
